
import Vue from 'vue'

const component = {
    // 具名插槽
    template: `
        <div :style="style">
            <div class="header">
                <slot name="header"></slot>
            </div>
            <div class="body">
                <slot name="body"></slot>
            </div>
        </div>
    `,
    data(){
        return {
            style: {
                width:"200px",
                height:"200px",
                border:'1px solid #aaa'
            }
        }
    },
    methods: {
        
    }
}

new Vue({
    components: {
        CompOne: component
    },
    el: '#root',
    data:{
        value: '123'
    },
    template: `
        <div>
            <comp-one>
                <span slot="header">this is header</span>
                <p slot="body">this is body</p>
            </comp-one>
        </div>
    `
})


